package com.springcloud.service;

import com.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @ProjectName: springcloud_day1
 * @Package: com.springcloud.service
 * @ClassName: DeptClientService
 * @Author: 郑涛
 * @Description:
 * @Date: 2020/10/23 17:00
 * @Version: 1.0
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientServiceFallbackFactory.class) //fallbackFactory  服务降级
public interface DeptClientService {
    @PostMapping("/dept/add")
    public boolean addDept(Dept dept);
    @GetMapping("/dept/QueryAll")
    public List<Dept> QueryAll();

    @GetMapping("/dept/get/{id}")
    public Dept getById(@PathVariable("id") Long id) ;

}
